using System;
using System.Collections.Generic;
using System.Text;

using Microsoft.Services.TfsAlert.InvokeNotify.WSProxy;

namespace Microsoft.Services.TfsAlert.InvokeNotify
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                StringBuilder URL = new StringBuilder();

                if (args.Length < 1 || "/?" == args[0])
                {
                    Console.WriteLine("You must enter a server and port, http://localhost:9999");
                    URL.Append(Console.ReadLine());
                }
                else
                {
                    URL.Append(args[0]);
                }

                URL.Append("/TFSAlert");

                Console.WriteLine("Calling :: " + URL.ToString() );

                NotificationReciever notificationReciever = new NotificationReciever();
                notificationReciever.Url = URL.ToString();

                notificationReciever.Notify("Message from InvokeNotify.exe test client", "tfsIdentityXML");

                Console.WriteLine(string.Empty);
                Console.WriteLine("Complete");
            }
            catch (Exception ex)
            {
                Console.WriteLine(string.Empty);
                Console.WriteLine("EXCEPTION :: " + ex.Message);
            }
        }
    }
}
